package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysWorkLineMapper;
import com.ruoyi.system.domain.SysWorkLine;
import com.ruoyi.system.service.ISysWorkLineService;

/**
 * 产线信息Service业务层处理
 * 
 * @author spark
 * @date 2023-07-23
 */
@Service
public class SysWorkLineServiceImpl implements ISysWorkLineService 
{
    @Autowired
    private SysWorkLineMapper sysWorkLineMapper;

    /**
     * 查询产线信息
     * 
     * @param workLineId 产线信息主键
     * @return 产线信息
     */
    @Override
    public SysWorkLine selectSysWorkLineByWorkLineId(Long workLineId)
    {
        return sysWorkLineMapper.selectSysWorkLineByWorkLineId(workLineId);
    }

    /**
     * 查询产线信息列表
     * 
     * @param sysWorkLine 产线信息
     * @return 产线信息
     */
    @DataScope(deptAlias = "d")
    @Override
    public List<SysWorkLine> selectSysWorkLineList(SysWorkLine sysWorkLine)
    {
        return sysWorkLineMapper.selectSysWorkLineList(sysWorkLine);
    }

    /**
     * 新增产线信息
     * 
     * @param sysWorkLine 产线信息
     * @return 结果
     */
    @Override
    public int insertSysWorkLine(SysWorkLine sysWorkLine)
    {
        sysWorkLine.setCreateTime(DateUtils.getNowDate());
        return sysWorkLineMapper.insertSysWorkLine(sysWorkLine);
    }

    /**
     * 修改产线信息
     * 
     * @param sysWorkLine 产线信息
     * @return 结果
     */
    @Override
    public int updateSysWorkLine(SysWorkLine sysWorkLine)
    {
        sysWorkLine.setUpdateTime(DateUtils.getNowDate());
        return sysWorkLineMapper.updateSysWorkLine(sysWorkLine);
    }

    /**
     * 批量删除产线信息
     * 
     * @param workLineIds 需要删除的产线信息主键
     * @return 结果
     */
    @Override
    public int deleteSysWorkLineByWorkLineIds(Long[] workLineIds)
    {
        return sysWorkLineMapper.deleteSysWorkLineByWorkLineIds(workLineIds);
    }

    /**
     * 删除产线信息信息
     * 
     * @param workLineId 产线信息主键
     * @return 结果
     */
    @Override
    public int deleteSysWorkLineByWorkLineId(Long workLineId)
    {
        return sysWorkLineMapper.deleteSysWorkLineByWorkLineId(workLineId);
    }
}
